﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace LCA.Community.DAL.Model
{
    /// <summary>
    /// This class represent the avatar of the user.
    /// </summary>
    public class Avatar : BasicStorageModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Avatar"/> class.
        /// </summary>
        public Avatar()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Avatar"/> class.
        /// </summary>
        /// <param name="userName">Name of the user.</param>
        /// <param name="url">The URL.</param>
        /// <param name="contentType">Type of the content.</param>
        /// <param name="stream">The stream.</param>
        public Avatar(string userName, Uri url, string contentType, Stream stream, string container)
        {
            Name = userName;
            Url = url;
            ContentType = contentType;
            Stream = stream;
            Container = container;
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return false;
            }

            var u = obj as Avatar;
            if (u == null)
            {
                return false;
            }

            return Name.Equals(u.Name) && Url.Equals(u.Url) && ContentType.Equals(u.ContentType);
        }
    }
}
